#include<iostream>
#include<queue>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
priority_queue<LL, vector<LL>, greater<LL>>q;
LL n, m, x;
LL arr[N];
int main()
{
	cin >> n >> m >> x;
	for (int i = 1; i <= n; i++) {
		LL v;
		cin >> v;
		arr[i] = (v + x - 1) / x;
	}
	for (int i = 1; i <= m; i++) {
		q.push(arr[i]);
	}
	for (int i = m + 1; i <= n; i++) {
		LL t = q.top();
		q.pop();
		q.push(arr[i] + t);
	}
	LL ans = 0;
	while (q.size()) {
		ans = q.top();
		q.pop();
	}
	cout << ans << endl;
	return 0;
}